package com.wty.basic.reflect;

/**
 * @Author wangtengyu
 * @Create 2018-08-09-9:52
 */
public class Student {





    //**********字段*************//
    public String name;
    protected int age;
    int sex;//0:男 1:女
    private String phoneNum;


    public Student() {
    }

    public Student(String name, int age, int sex, String phoneNum) {
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.phoneNum = phoneNum;
    }
    private Student(String name, int age) {
        this.name = name;
        this.age = age;
    }
    protected Student(String name, int age,int sex) {
        this.name = name;
        this.age = age;
    }

    public void show1(String s) {
        System.out.println("调用了：公有的，String参数的show1(): s = " + s);
    }

    protected void show2() {
        System.out.println("调用了：受保护的，无参的show2()");
    }

    void show3() {
        System.out.println("调用了：默认的，无参的show3()");
    }

    private String show4(int age) {
        System.out.println("调用了，私有的，并且有返回值的，int参数的show4(): age = " + age);
        return "abcd";
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                ", phoneNum='" + phoneNum + '\'' +
                '}';
    }
}